import 'package:json_annotation/json_annotation.dart';
part 'news_detail_model.g.dart';

@JsonSerializable()
class NewsDetailModel {
  String id;
  String source;
  String created_at;
  String content;
  List<String> images;
  List<String> videos;
  int likes;
  int comments;
  int shares;
  int views;
  String nickname;
  String profile_picture;
  String? title;
  int like_status; //0-点赞 1-未点赞
  NewsDetailModel(
      {required this.id,
      required this.source,
      required this.created_at,
      required this.content,
      required this.images,
      required this.videos,
      required this.likes,
      required this.comments,
      required this.shares,
      required this.views,
      required this.profile_picture,
      required this.nickname,
      required this.like_status,
      this.title});

  factory NewsDetailModel.fromJson(Map<String, dynamic> json) =>
      _$NewsDetailModelFromJson(json);

  Map<String, dynamic> toJson() => _$NewsDetailModelToJson(this);
}
